﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.Silverlight.Testing;

namespace RssProxyService.Test.Integration
{
    [TestClass]
    public class RssProxyServiceIntegrationTests : SilverlightTest
    {
        private RssProxyService service;

        [TestInitialize]
        public void SetUpTest()
        {
            this.service = new RssProxyService(() => new System.Net.WebClient(), "http://the-prophet.tumblr.com/rss", new RssMapper());
        }

        [TestMethod]
        [Asynchronous]
        public void GetArticlesAsync_InternetAccessOnSiteIsAvailable_ItemsNotNull()
        {
            this.service.GetArticlesAsync(items =>
            {
                Assert.IsNotNull(items);
                base.EnqueueTestComplete();
            });
        }
    }
}
